﻿using CommonModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CommonUtils
{
    public static class ExtendUtils
    {
        /// <summary>
        /// 把某列翻译为Enum 描述
        /// </summary>
        /// <param name="rs"></param>
        /// <param name="colName"></param>
        /// <param name="textName"></param>
        /// <param name="enumType"></param>
        /// <returns></returns>
        public static ResultSet AddEnumTextField(this ResultSet rs, string colName, string textName, Type enumType)
        {
            var dic = EnumUtil.EnumToDictionary(enumType); 
            return rs.AddTextField(colName,textName,dic);
        }
    }
}
